﻿using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Hosting;
using System.Threading;
using System.Threading.Tasks;
using Zocono.WCS.Domain.WcsGetWmsJobDomain;

namespace Zocono.WCS.HangfireHost.StartAndStopService
{
    /// <summary>
    /// 检测启动和退出
    /// </summary>
    public class StartAndStopCheckService : IHostedService
    {
        /// <summary>
        /// 启动入口
        /// </summary>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        /// <exception cref="System.NotImplementedException"></exception>
        public async Task StartAsync(CancellationToken cancellationToken)
        {
        }

        /// <summary>
        /// 退出入口
        /// </summary>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        /// <exception cref="System.NotImplementedException"></exception>
        public async Task StopAsync(CancellationToken cancellationToken)
        {
            Program.isRunning = false;
        }

    }
}
